package nl.ceasaro.jeubelix.mvc;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractFormController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by IntelliJ IDEA.
 * User: cees
 * Date: Apr 14, 2007
 * Time: 9:03:31 PM
 *
 * @todo Document this class
 */
public abstract class AbstractJeubelixController extends AbstractFormController
{
   protected final ModelAndView showForm(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, BindException bindException) throws Exception
   {
      return showJeubelixForm(httpServletRequest, httpServletResponse, bindException);
   }

   protected abstract ModelAndView showJeubelixForm(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, BindException bindException) throws Exception;

   protected final ModelAndView processFormSubmission(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object, BindException bindException) throws Exception
   {
      return processJeubelixForm(httpServletRequest, httpServletResponse, object, bindException);
   }

   protected abstract ModelAndView processJeubelixForm(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object, BindException bindException) throws Exception;

}
